import Moment from "@/components/app/Moment";
import ByCell from "@/components/ui/ByCell";
import ByCellGroup from "@/components/ui/ByCellGroup";

import { ContractInfo } from "@/types/contract";

const cellProps = { align: "right" } as const;

// 合同信息
export default ({ data }: { data?: ContractInfo }) => {
  return (
    data && (
      <ByCellGroup>
        <ByCell label="合同编号" {...cellProps}>
          {data.constructionContractNo}
        </ByCell>
        <ByCell label="合同签订日期" {...cellProps}>
          <Moment value={data.contractDate} />
        </ByCell>
        <ByCell label="工期" {...cellProps}>
          {data.contractDuration}
        </ByCell>
        <ByCell label="预计开工日期" {...cellProps}>
          <Moment value={data.plandBeginDate} />
        </ByCell>
        <ByCell label="预计完工日期" {...cellProps}></ByCell>
        <ByCell label="实际开工日期" {...cellProps}>
          <Moment value={data.realBeginDate} />
        </ByCell>
        <ByCell label="实际完工日期" {...cellProps}>
          <Moment value={data.realEndDate} />
        </ByCell>
        <ByCell label="施工状况" {...cellProps}></ByCell>
        <ByCell label="施工合同金额" {...cellProps}>
          {data.contractAmount}
        </ByCell>
        <ByCell label="合同特殊条款" {...cellProps}></ByCell>
        <ByCell label="施工合同备注" {...cellProps}>
          {data.remark}
        </ByCell>
      </ByCellGroup>
    )
  );
};
